import { exRadioGroup } from '@ve/common/components/extension'
export let PDATABLE = {
  name: '表格',
  list: [
    {
      name: '双击获取表格值',
      event: 'pdaGetTabLine',
      explain: '双击获取表格选中行表格值',
      extension: {
        useTabData: {
          type: 'exSwitch',
          value: true,
          name: '使用本行数据',
        },
        getDataKey: {
          name: '获取数据Key',
          type: 'exInput',
          value: '',
          tooltip: '通过 key 筛选数据；多个 key 用 ‘,’ 分隔。',
        },
      },
    },
    {
      name: '单击获取表格值',
      event: 'pdaClickGetTable',
      explain: '单击获取选中行表格值',
      extension: {
        checkbox: {
          name: '获取多选值',
          type: 'exSwitch',
          value: false,
          tooltip: '获取多选选中的表格数据',
        },
        tableSelect: {
          type: 'exPdaTreeSelect',
          name: '表格选择',
          value: [],
          hasCheckbox: false,
          treeData: '$getPageModules',
          filter: ['uiPdaTable'],
        },
        getDataKey: {
          name: '获取数据Key',
          type: 'exInput',
          value: '',
          tooltip: '通过 key 筛选数据；多个 key 用 ‘,’ 分隔。',
        },
        getLength: {
          name: '获取数据长度',
          type: 'exSwitch',
          value: false,
          tooltip: '获取多选选中的数据长度',
        },
      },
    },
    {
      name: '自动选中搜索项',
      event: 'pdaSearchChioce',
      explain: '自动选中可以多选的的表格，输入框的值用于选中表格匹配上的值',
      extension: {
        tableSelect: {
          type: 'exPdaTreeSelect',
          name: '表格选择',
          value: [],
          hasCheckbox: false,
          treeData: '$getPageModules',
          filter: ['uiPdaTable'],
        },
        getDataKey: {
          name: '匹配字段',
          type: 'exInput',
          value: '',
          tooltip: '通过该字段自动匹配输入框的数据；多个字段用 ‘,’ 分隔。',
        },
        errorMsg: {
          name: '错误提示',
          type: 'exInput',
          value: '',
          tooltip: '若输入框中内容无法在表格中匹配到相关数据时的错误提示。',
        },
      },
    },
    {
      name: '获取输入框值',
      event: 'pdaGetInputData',
      explain: '用于获取表格上模糊匹配框的值',
      extension: {
        useInpData: {
          type: 'exSwitch',
          value: true,
          name: '获取输入框值',
        },
      },
    },
    {
      name: '删除本行表格值',
      event: 'pdaDelTabLine',
      explain: '用于表格删除选中行',
      extension: {
        useTableData: {
          type: 'exSwitch',
          value: true,
          name: '删除本行数据',
        },
      },
    },
    {
      name: '切换表格按钮状态',
      event: 'pdaSwitchTableBtn',
      explain: '切换表格操作按钮的显示、隐藏状态。',
      extension: {
        tableSelect: {
          type: 'exPdaTreeSelect',
          name: '表格选择',
          value: [],
          hasCheckbox: false,
          treeData: '$getPageModules',
          filter: ['uiPdaTable'],
        },
        buttonSelect: {
          type: 'exPdaTableBtnSelect',
          name: '表格操作按钮选择',
          value: [],
        },
        buttonStatu: exRadioGroup('按钮状态', 'show', [
          { value: 'show', label: '显示' },
          { value: 'hidden', label: '隐藏' },
        ]),
      },
    },
  ],
}
